﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ucc="clr-namespace:BookReader.Controls"
    >

    <!-- Rectangle Style for Window borders and header -->
    <Style x:Key="RectangleFrame" TargetType="{x:Type Rectangle}">
        <Setter Property="RadiusX" Value="16"/>
        <Setter Property="RadiusY" Value="16"/>
        <Setter Property="Opacity" Value="0.8"/>
        <Setter Property="StrokeThickness" Value="0"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="Fill" Value="{DynamicResource WindowBackgroundBrush}"/>
        <Setter Property="BitmapEffect">
            <Setter.Value>
                <DropShadowBitmapEffect></DropShadowBitmapEffect>
            </Setter.Value>
        </Setter>    
    </Style>

    <!-- Header control-->
    <Style x:Key="Header" TargetType="{x:Type ucc:Header}">
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ucc:Header}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="2" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="60" />
                            <ColumnDefinition Width="10" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Rectangle Grid.ColumnSpan="3" Grid.RowSpan="2" RadiusX="16" RadiusY="16" Fill="{DynamicResource ShineBrush}" />
                        <Image Grid.RowSpan="2" x:Name="imageHeaderCtrl" Margin="6" Source="{TemplateBinding Image}" />

                        <TextBlock Grid.Column="2" x:Name="titleHeaderCtrl" FontWeight="Bold" Margin="0,0,0,1"
			                Foreground="{DynamicResource TextBrush}" VerticalAlignment="Center" FontSize="15"
                            Text="{TemplateBinding Title}"
                            />

                        <TextBlock Grid.Column="2" Grid.Row="1" x:Name="contentHeaderCtrl" 
		                    Foreground="{DynamicResource TextBrush}" TextWrapping="Wrap" VerticalAlignment="Center"
                            Text="{TemplateBinding Description}"
                            />
                        <Rectangle Grid.ColumnSpan="3" Grid.Row="2" VerticalAlignment="Stretch" 
                                   Fill="{DynamicResource DefaultedBorderBrush}" Visibility="{TemplateBinding HasSeparator }"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>